<template>
  <a-directory-tree multiple style="color:white" @rightClick="rightClick" default-expand-all @select="onSelect" @expand="onExpand">
    <a-tree-node  :key="Jkey" :title="name">
      <a-tree-node :key="i['id']" :title="getName(i['dirname'],i['filename'])" v-if="i['is_dir']==1" v-for="i in list"/>
      <a-tree-node :key="i['id']" :title="getName(i['dirname'],i['filename'])" v-if="i['is_dir']==0" is-leaf v-for="i in list"/>
      <Jmenu :name="i['dirname']" :key="i['id']+'_n'" :Jkey="i['id']+'_n'" v-if="i['children']" :list="i['children']" v-for="i in list"/>
    </a-tree-node>
  </a-directory-tree>
</template>

<script>
export default {
  name: "Jmenu",
  data(){
    return {

    }
  },
  created() {
    console.log("========?")
  },
  methods:{
    getName(dirname,fileName){
      if (fileName!=null&&fileName.length>0){
        return fileName
      }
      return dirname
    },
    rightClick(){

    },
    onSelect(keys, event) {
      console.log('Trigger Select', keys, event);
    },
    onExpand(){
      console.log('Trigger Expand');
    },
  },
  props:{
    data:[],
    list:null,
    root:true,
    name:"",
    Jkey:"",
  }
}
</script>

<style scoped>

</style>
